/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Entidades;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Embeddable;
import javax.validation.constraints.NotNull;

/**
 *
 * @author Damian
 */
@Embeddable
public class CityPK implements Serializable {
    @Basic(optional = false)
    @NotNull
    @Column(name = "ID_CITY")
    private int idCity;
    @Basic(optional = false)
    @NotNull
    @Column(name = "ID_COUNTRY")
    private int idCountry;

    public CityPK() {
    }

    public CityPK(int idCity, int idCountry) {
        this.idCity = idCity;
        this.idCountry = idCountry;
    }

    public int getIdCity() {
        return idCity;
    }

    public void setIdCity(int idCity) {
        this.idCity = idCity;
    }

    public int getIdCountry() {
        return idCountry;
    }

    public void setIdCountry(int idCountry) {
        this.idCountry = idCountry;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (int) idCity;
        hash += (int) idCountry;
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof CityPK)) {
            return false;
        }
        CityPK other = (CityPK) object;
        if (this.idCity != other.idCity) {
            return false;
        }
        if (this.idCountry != other.idCountry) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "Entidades.CityPK[ idCity=" + idCity + ", idCountry=" + idCountry + " ]";
    }
    
}
